﻿using System;
using System.Text;
using ProjScan.Tools;
using UnityEditor;
using UnityEngine;

namespace ProjScan.RecordManager.AssetData
{
	// Token: 0x02000297 RID: 663
	internal abstract class ComponentAssetData<TComponent> : AssetDataBase where TComponent : Component
	{
		// Token: 0x06001158 RID: 4440 RVA: 0x000085A2 File Offset: 0x000067A2
		public ComponentAssetData(int newDirectoryId, string newName, TComponent newComponent)
		{
			this.component = newComponent;
			this.directoryId = newDirectoryId;
			this.name = newName;
			this.assetPath = AssetDatabase.GetAssetPath(this.component);
		}

		// Token: 0x06001159 RID: 4441 RVA: 0x00051DE8 File Offset: 0x0004FFE8
		public override string GetCSVHeader()
		{
			return "Name,DirID";
		}

		// Token: 0x0600115A RID: 4442 RVA: 0x00051E00 File Offset: 0x00050000
		public override string GetInfo()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(ToolsHelper.QuoteString(this.name));
			stringBuilder.Append(',');
			stringBuilder.Append(this.directoryId);
			return stringBuilder.ToString();
		}

		// Token: 0x0600115B RID: 4443 RVA: 0x000085D7 File Offset: 0x000067D7
		public override void Reset()
		{
			this.component = default(TComponent);
		}

		// Token: 0x0600115C RID: 4444 RVA: 0x00051E48 File Offset: 0x00050048
		public override string GetAssetPath()
		{
			bool flag = this.name.EndsWith(".prefab");
			string result;
			if (flag)
			{
				result = this.assetPath;
			}
			else
			{
				result = string.Format("{0}${1}", this.assetPath, this.name);
			}
			return result;
		}

		// Token: 0x0600115D RID: 4445 RVA: 0x00051E90 File Offset: 0x00050090
		public override string GetFileAssetPath()
		{
			return this.assetPath;
		}

		// Token: 0x04000A16 RID: 2582
		public int directoryId;

		// Token: 0x04000A17 RID: 2583
		public string name;

		// Token: 0x04000A18 RID: 2584
		public TComponent component;

		// Token: 0x04000A19 RID: 2585
		protected string assetPath;
	}
}
